import request from '@/plugins/axios'
import qs from 'qs'
export default {
  //得到所有车辆
  getCarList() {
    return request({
      url: '/car/getAllCar',
      method: 'get',
    })
  },
  //得到车辆类型
  getTypeList() {
    return request({
      url: '/car/getCarType',
      method: 'get',
    })
  },
  //查询车辆
  chaXun(carNumber, carTypeId, status) {
    return request({
      url: '/car/getAllCar',
      method: 'get',
      params: {
        carNumber: carNumber,
        carTypeId: carTypeId,
        status: status,

      }
    })
  },
  //新增车辆
  xinZeng(carNumber, carTypeId, capacity, engineNumber, status, comment) {
    return request({
      url: '/car/addCarInfo',
      method: 'post',
      data: {
        carNumber: carNumber,
        carTypeId: carTypeId,
        capacity: capacity,
        engineNumber: engineNumber,
        status: status,
        comment: comment,
      }
    })
  },
  //删除车辆
  deleteCar(id) {
    return request({
      url: '/car/delCarInfo',
      method: 'get',
      params: {
        id: id
      }
    })
  },
  //修改车辆
  updateCar(id, carNumber, carTypeId, capacity, engineNumber, status, comment) {
    return request({
      url: '/car/editCarInfo',
      method: 'post',
      data: {
        id: id,
        carNumber: carNumber,
        carTypeId: carTypeId,
        capacity: capacity,
        engineNumber: engineNumber,
        status: status,
        comment: comment
      }
    })
  }

}